<?php

/* @var $this yii\web\View */
use yii\helpers\Html;

$this->title = Yii::$app->name;
?>

<div class="site-chat">

</div>

<?php \common\components\widgets\JsBlock::begin() ?>
    <script>
        $(function () {

        });
        var wsIp = "<?php echo \common\config\Env::getSwooleWebsocketConf()['ip'] ?>";
        var wsPort = "<?php echo \common\config\Env::getSwooleWebsocketConf()['port'] ?>";
        /*var wsServer = 'ws://'+wsIp+':'+wsPort;
        var websocket = new WebSocket(wsServer);
        websocket.onopen = function (evt) {
            console.log("Connected to WebSocket server.");
            websocket.send('fasdfsadf');
        };
        websocket.onclose = function (evt) {
            console.log("Disconnected");
        };
        websocket.onmessage = function (evt) {
            console.log('Retrieved data from server: ' + evt.data);
        };
        websocket.onerror = function (evt, e) {
            console.log('Error occured: ' + evt.data);
        };*/
    </script>
<?php \common\components\widgets\JsBlock::end() ?>